package com.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 配置文件注入类
 * @author yyq
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring")
public class ApplicationEntity {

    /** 获取数据库配置*/
    private DatasourceProperties datasource = new DatasourceProperties();

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    public class DatasourceProperties {
        private String driverClassName;
        private String url;
        private String username;
        private String password;
    }

}
